<template>
  <div class="bg">
    <el-main class="main">
      <div class="login-box">
        <div class="login-box-header">
          <h3 class="login-box-header-title">用户登录</h3>
        </div>
        <div class="login-box-body">
          <el-form ref="form">
            <el-form-item>
              <el-input placeholder="用户名" v-model="username">
                <template slot="prepend">
                  <i class="iconfont icon-user"></i>
                </template>
              </el-input>
            </el-form-item>
            <el-form-item>
              <el-input type="password" placeholder="密码" v-model="password">
                <template slot="prepend">
                  <i class="iconfont icon-password"></i>
                </template>
              </el-input>
            </el-form-item>
            <el-form-item>
              <el-button class="login-btn" type="primary" @click="login()">登录</el-button>
            </el-form-item>
          </el-form>
        </div>
      </div>
    </el-main>
  </div>
</template>
<script lang="ts">
  import { Vue, Component } from 'vue-property-decorator';

  @Component
  export default class Login extends Vue {
    public username: string = '';
    public password: string = '';

    public login(): void {
      this.$router.push({
        name: 'CourseAll',
      });
    }
  }
</script>
<style lang="scss" scoped>
  @import "../assets/scss/var.scss";
  .bg {
    background-image: url(/img/login-bg.jpg);
    background-size: 100% 100%;
    background-position: center;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
  }
  .login-box {
    float: right;
    width: 400px;
    margin-top: 200px;
    margin-right: 100px;
    box-sizing: border-box;
    padding: 20px 20px;
    border-radius: 5px;
    background-color: rgba($black, .6);
    color: $white;
    .login-box-header-title {
      font-size: 25px;
      line-height: 40px;
      height: 40px;
      text-align: center;
    }
    .login-btn {
      width: 100%;
    }
  }
</style>
